Add centered pressure gradient#353
Conversation
Polaris
|
xylar
left a comment
There was a problem hiding this comment.
Approving based on @sbrus89 and my testing of the code in Polaris (both based on a python implementation of the Omega algorithm and a high-fidelity reference solution produced by vertical numerical quadrature and 4th-order horizontal gradients), and a careful inspection of the code changes.
|
The |
|
The |
|
The |
|
This now passes CTests with gnu Release/Debug on pm-cpu and gnugpu Release/Debug on pm-gpu. |
- Average specific volume to interfaces - Average product of spcific volume and pressure to edge - Add centered and high order functor constructors - Format linting
| VCoord->computePressure(LayerThick, SurfacePressure); | ||
| OMEGA_SCOPE(LocPressureMid, VCoord->PressureMid); | ||
| Array2DReal Temp = Tracers::getByName(VelTimeLevel, "Temperature"); | ||
| Array2DReal Salinity = Tracers::getByName(VelTimeLevel, "Salinity"); |
There was a problem hiding this comment.
Using VelTimeLevel doesn't seem right here too, but it is a bit harder to fix. One option is to make computeVelocityTendenciesOnly and computeVelocityTendencies take in the same TracerArray that gets passed to computeAllTendencies. Another one is to add TracerTimeLevel everywhere.
brian-oneill
left a comment
There was a problem hiding this comment.
Everything looks good. Ran the ctests successfully on pm-cpu and pm-gpu. Just a couple things below, nothing major.
|
Thanks for the feedback @mwarusz and @brian-oneill. I think I've addressed your comments in the the last couple commits. @mwarusz, I choose to add Related to the |
|
This passes CTests on pm-gpu and pm-cpu as well as the omega_pr suite on pm-cpu. |
|
Oops, turns out that using get temperature and salinity from the tracers array in the singleton In general, I believe that we should have |
|
@mwarusz , that makes sense with respect to RK4. I'm open to making Tracers a non-singleton class, but I suppose we could also pass the 3D Tracer array (either from |
|
@mwarusz, I am now passing a tracer array into |
|
Tested head on perlmutter gnu CPU, GPU, and passes all cTests. I tested the baroclinic channel using etc for both MPAS-O and Omega, for resolutions 10km, 4km, 1km. All use the default namelist except I set horizontal viscosity (del2) to 20 m^2/s^2 to match the Petersen et al. 2015 paper. Omega simulations generally have the right behavior, but with some notable differences. Here is
https://github.com/user-attachments/assets/c19c2d18-381e-46cc-9b8e-a021dc6f1588 |
mark-petersen
left a comment
There was a problem hiding this comment.
Obviously, we have some work to do. However, I think we should go ahead and merge this PR and then continue testing on develop. The convergence tests for the pressure gradient term, above, show that this term is working as designed. The issues in my last post are likely due to other terms, or the interaction of terms that passed their individual tests.
|
Here is some initial timing information. This is not specific to this PR, but I thought I would post it here because the pressure gradient allows us to collect timing data for primitive equation tests for the first time. Using the branch Summary of Omega vs MPAS-O timing with primitive equation terms. |
hyungyukang
left a comment
There was a problem hiding this comment.
I tested this PR after merging it into the time-stepping working branch (https://github.com/hyungyukang/Omega/tree/hkang/omega/new-test-branch).
Using that branch, I ran the Omega horizontal pressure gradient test in Polaris (E3SM-Project/polaris#465) and got the same convergence rate reported by @sbrus89 above:
|
As @mark-petersen noted, I have also observed somewhat different behavior between Omega and MPAS-O in the baroclinic channel test at 4 km resolution. Below are my results from the 4 km baroclinic channel test, along with a comparison between Omega and MPAS-Ocean. Waves appear in Omega by day 20, similar to what @mark-petersen reported at 1 km resolution. The time series of the domain-integrated kinetic energy: |
|
@mark-petersen and @hyungyukang, if you said, U missed it but are you using a second order pressure gradient in MPAS-O as well in your tests? |
@xylar , I’ve been using |
|
Okay, that's likely the closest equivalent. Sounds right. |
|
I ran experiments with real bottom topography at QU240km resolution without forcing (kind of a spin-down configuration). Omega blows up within 4 hours, producing NaN values in the variables, whereas MPAS-O remains stable through 20 days. When the PGF term is disabled, although this is not a physically appropriate configuration, Omega also remains stable through 20 days. The instability in Omega may be caused either by its interaction with other terms or by the PGF term itself, and this will need to be investigated further. |
hyungyukang
left a comment
There was a problem hiding this comment.
I’m approving this PR based on the cTests, Polaris tests, and the thorough reviews from the other reviewers. The PR appears to be working as intended. However, the issue we are seeing may be due to the combination of other terms. I think we can move forward with merging this PR into develop and revisit the issue afterward.
@sbrus89, thank you very much for your great work!
|
Merged locally into |










This PR adds a centered, second-order accurate, horizontal pressure gradient tendency term to Omega.
Checklist
Testingwith the following:have been run on and indicate that are all passing.
has passed, using the Polaris
e3sm_submodules/Omegabaseline-pfor both the baseline (Polarise3sm_submodules/Omega) and the PR build